Ephemeral port

An ephemeral port is a short-lived transport protocol port for Internet Protocol (IP) communications allocated automatically from a predefined range by the TCP/IP software. It is used by the Transmission Control Protocol (TCP), User Datagram Protocol (UDP), or the Stream Control Transmission Protocol (SCTP) as the port assignment for the client end of a client–server communication to a well known port on a server. On servers, ephemeral ports may also be used to continue communications with a client that initially connected to one of the server's well-known service listening ports to make the well-known port available to service requests from other clients. The allocations are temporary and only valid for the duration of the communication session. After completion of the communication session, the ports become available for reuse.[note 1]

The Internet Assigned Numbers Authority (IANA) suggests the range 49152 to 65535 for dynamic or private ports.[1]

Many Linux kernels use the port range 32768 to 61000.[note 2] FreeBSD has used the IANA port range since release 4.6. Previous versions, including the Berkeley Software Distribution (BSD), use ports 1024 through 5000 as ephemeral ports.[2] Microsoft Windows operating systems through Server 2003 use the range 1025 to 5000 as ephemeral ports.[3] Windows Vista, Windows 7, and Server 2008 use the IANA range.[4]

Contents

See also

Notes

  1. ^ Most implementations may simply increment the last used port number until the ephemeral port range is exhausted.
  2. ^ The effective range is accessible via the /proc file system at node /proc/sys/net/ipv4/ip_local_port_range.

References

  1. ^ IANA port number assignments
  2. ^ [UNIX Network Programming, Volume 1, Second Edition: Networking APIs: Sockets and XTI, Prentice Hall, 1998, ISBN 0-13-490012-X, pp. 42-43]
  3. ^ Microsoft Windows Technet Library
  4. ^ KB Article 929851

External links

This article was originally based on material from the Free On-line Dictionary of Computing, which is licensed under the GFDL.